domoticz: build with -flto
authorDavid Woodhouse <[email protected]>
Tue, 22 May 2018 12:41:34 +0000 (13:41 +0100)
committerDavid Woodhouse <[email protected]>
Mon, 4 Jun 2018 10:11:23 +0000 (11:11 +0100)
This makes quite a significant difference to the executable size:

   text    data     bss     dec     hex filename
7921421   87804   31692 8040917  7ab1d5 domoticz
5862321   86180   31212 5979713  5b3e41 domoticz-lto

As an added bonus, it still seems to work.

Signed-off-by: David Woodhouse <[email protected]>
utils/domoticz/Makefile

index d8dee81390ead2b9b0eb650d643873312d10fa9f..ba240960dce06b2d9d56ade2cffed6c821d7ea83 100644 (file)
@@ -62,7 +62,8 @@ CMAKE_OPTIONS += \
        -DUSE_STATIC_OPENZWAVE=no \
        -DUSE_PYTHON=no
 
-TARGET_CXXFLAGS+=-DWITH_GPIO
+TARGET_CFLAGS+=-flto
+TARGET_CXXFLAGS+=-DWITH_GPIO -flto
 
 define Build/Prepare
        $(call Build/Prepare/Default)